
// config the class of our span i would like to get
export interface Config {
    // content of text
    content: string,
    // class name list of out textContent
    classNameArr: Array<string>
    // subject
    labelSubject: Array<object>
}

const defaultValues:Config ={
    content: "",
    classNameArr: ['molar-nlp-content'],
    labelSubject: [
        {
            subjectTitle: '企业',
            subjectPredicate: ['拥有','所属','合作伙伴','开展'],
            objects: ['产品','行业','企业','业务']
        },
        {
            subjectTitle: '产品',
            subjectPredicate: ['上游','来自','属于'],
            objects: ['产品','行业']
        },
    ]
}

export function parseInput(input:Config){
    let result = {};
    for (let entry in defaultValues) {
        // @ts-ignore
        // noinspection JSUnfilteredForInLoop
        result[entry] = input[entry] !== undefined ? input[entry] : defaultValues[entry];
    }
    return result as Config;
}